import React, { useState } from 'react'

export default function App() {
    //name是状态,setName是改变name的唯一方法,最好语义化名字 useState类似vue3的定义 useState([])
    const [name, setName] = useState("lyz")
    const [age, setAge] = useState("24")
    return (
        <div>
            <button onClick={() => {
                //传入新值 会自动更改原状态
                setName("new lyz")
                setAge("25")
            }}>click</button>
            <div>name-{name}</div>
            <div>age-{age}</div>
        </div>
    )
}
